package com.daniele.helloworld;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class ResultActivity extends Activity implements OnClickListener{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_result);
		
		final TextView result = (TextView) findViewById(R.id.textViewResult);
		Bundle bundle = this.getIntent().getExtras();
		result.setText(bundle.getString("input"));
		
		 final Button button = (Button)findViewById(R.id.backButton);
	     button.setOnClickListener(this);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.result, menu);
		return true;
	}

	@Override
	public void onClick(View arg0) {
		Intent hello_intent = new Intent(getApplicationContext(), HelloWorldActivity.class);
		startActivity(hello_intent);
	}

}
